<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Model</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Model</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
							<a href="#sec-descendents">Descendents</a>
			|											<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The base model-class that all models derive from</p>
	<ul class="tags">
				<li><span class="field">todo:</span> review replace() (emulation in mssql vs. remove), query only supports basic Commands (but easily can support all)</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_kata---lib---model.php.html">/kata/lib/model.php</a> (line <span class="field">43</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>

	<a name="sec-descendents"></a>
	<div class="info-box">
		<div class="info-box-title">Direct descendents</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
			<span class="disabled">Descendents</span>
			|												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
								|															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<table cellpadding="2" cellspacing="0" class="class-table">
				<tr>
					<th class="class-table-header">Class</th>
					<th class="class-table-header">Description</th>
				</tr>
								<tr>
					<td style="padding-right: 2em; white-space: nowrap">
						<img src="../media/images/Class.png"
								 alt=" class"
								 title=" class"
								 style="vertical-align: center"/>
						<a href="../kata_model/ClusterModel.html">ClusterModel</a>
					</td>
					<td>
											The cluster enabled model-class
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; white-space: nowrap">
						<img src="../media/images/Class.png"
								 alt=" class"
								 title=" class"
								 style="vertical-align: center"/>
						<a href="../kata_model/AppModel.html">AppModel</a>
					</td>
					<td>
											A dummy-class that is included if the user does not supply an appmodel.
										</td>
				</tr>
							</table>
		</div>
	</div>


	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendants</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$connection" title="details" class="var-name">$connection</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">object</span>
					<a href="#$dboClass" title="details" class="var-name">$dboClass</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$useIndex" title="details" class="var-name">$useIndex</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$useTable" title="details" class="var-name">$useTable</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendants</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																																																																																																																								<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#bulkcreate" title="details" class="method-name">bulkcreate</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#cachedQuery" title="details" class="method-name">&amp;cachedQuery</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$idname</span> = <span class="var-default">false</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$cacheid</span> = <span class="var-default">false</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$ttl</span> = <span class="var-default">0</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#changeConnection" title="details" class="method-name">changeConnection</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$connName</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#create" title="details" class="method-name">create</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">object intialized</span>
										<a href="#dbo" title="details" class="method-name">dbo</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#delete" title="details" class="method-name">delete</a>
											([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">array</span>
										<a href="#describe" title="details" class="method-name">&amp;describe</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#escape" title="details" class="method-name">escape</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#find" title="details" class="method-name">find</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span> = <span class="var-default">''</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">array ()</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#getConfig" title="details" class="method-name">getConfig</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$what</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#getConnectionName" title="details" class="method-name">getConnectionName</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#getLink" title="details" class="method-name">getLink</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#getModel" title="details" class="method-name">getModel</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$name</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getPrefix" title="details" class="method-name">getPrefix</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getTableName" title="details" class="method-name">getTableName</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$n</span> = <span class="var-default">null</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$withPrefix</span> = <span class="var-default">true</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$quoted</span> = <span class="var-default">true</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getWhereString" title="details" class="method-name">getWhereString</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$allowKey</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#log" title="details" class="method-name">log</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$what</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$where</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#makeDateTime" title="details" class="method-name">makeDateTime</a>
											(<span class="var-type">integer</span>&nbsp;<span class="var-name">$t</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#pairs" title="details" class="method-name">pairs</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">mixed</span>
										<a href="#query" title="details" class="method-name">&amp;query</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$idnames</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#quote" title="details" class="method-name">quote</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#quoteName" title="details" class="method-name">quoteName</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#read" title="details" class="method-name">read</a>
											([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">null</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$fieldName</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#replace" title="details" class="method-name">replace</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>], <span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setupDbo" title="details" class="method-name">setupDbo</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$connName</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#update" title="details" class="method-name">update</a>
											([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">null</span>], <span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">bool</span>
										<a href="#validate" title="details" class="method-name">validate</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$what</span> = <span class="var-default">null</span>])
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$connection" id="$connection"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$connection</span>
			 = <span class="var-default"> 'default'</span>			(line <span class="line-number">49</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">which connection to use of the ones defines inside config/database.php</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$dboClass" id="$dboClass"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">object</span>
			<span class="var-name">$dboClass</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">71</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">containts the appropriate class used to access the database</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$useIndex" id="$useIndex"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$useIndex</span>
			 = <span class="var-default"> 'id'</span>			(line <span class="line-number">64</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">which fieldname to use for primary key. is 'id' by default, override it in your  model wo 'table_id' or 'tableId' as you like.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$useTable" id="$useTable"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$useTable</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">56</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">whether to use a specific table for this model. false if not specific, otherwise the tablename</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodbulkcreate" id="bulkcreate"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">bulkcreate</span> (line <span class="line-number">636</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">mass insert function</p>
	<ul class="tags">
				<li><span class="field">return:</span> number of successfully inserted rows</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			bulkcreate
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: array of row-array to insert</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$tableName</span><span class="var-description">: name of table to use or null for model default</span>			</li>
				</ul>
		
			
	</div>
<a name="methodcachedQuery" id="cachedQuery"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">cachedQuery</span> (line <span class="line-number">219</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Do a query that is cached via the cacheUtility. caching is done 'dumb', so altering the database wont invalidate the cache</p>
<p class="description"><p>A word of warning: If you dont supply an $idname, queries on different lines will result in different cachefiles</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			&amp;cachedQuery
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$idname</span> = <span class="var-default">false</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$cacheid</span> = <span class="var-default">false</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$ttl</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$s</span><span class="var-description">: sql-string</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$idname</span><span class="var-description">: if set the key of the array is set to the value of this field of the result-array. So the result is not numbered from 0..x but for example the value of the primary key</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$cacheid</span><span class="var-description">: the id used to store this query in the cache. if ommited we try to build a suitable key</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$ttl</span><span class="var-description">: time to live in seconds (0=infinite)</span>			</li>
				</ul>
		
			
	</div>
<a name="methodchangeConnection" id="changeConnection"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">changeConnection</span> (line <span class="line-number">124</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">allowes you to switch the current connection dynamically.</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			changeConnection
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$connName</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$connName</span><span class="var-description">: name of the new connection to use</span>			</li>
				</ul>
		
			
	</div>
<a name="methodcreate" id="create"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">create</span> (line <span class="line-number">659</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">insert a record into the database.</p>
<p class="description"><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methodcreate">create</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'fooId'</span>=&gt;<span class="src-num">1</span><span class="src-sym">,</span><span class="src-str">'int1'</span>=&gt;<span class="src-num">10</span><span class="src-sym">,</span><span class="src-str">'int2'</span>=&gt;<span class="src-num">20</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			create
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: name=&gt;value pairs to be inserted into the table</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tableName</span><span class="var-description">: insert into this table (if ommitted: use tablename of this model, including prefix)</span>			</li>
				</ul>
		
			
	</div>
<a name="methoddbo" id="dbo"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">dbo</span> (line <span class="line-number">88</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">lazy setup dbo the first time its used</p>
	<ul class="tags">
				<li><span class="field">return:</span> dbo-class</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">object intialized</span>
		<span class="method-name">
			dbo
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoddelete" id="delete"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">delete</span> (line <span class="line-number">692</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">delete the row whose id is matching</p>
<p class="description"><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methoddelete">delete</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'rowId'</span>=&gt;<span class="src-num">10</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methoddelete">delete</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'rowId'</span>=&gt;<span class="src-num">20</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'and'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'parentId'</span>=&gt;<span class="src-num">10</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">))</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			delete
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$id</span><span class="var-description">: primary key of row to delete</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tableName</span><span class="var-description">: delete from this table (if ommitted: use tablename of this model, including prefix)</span>			</li>
				</ul>
		
			
	</div>
<a name="methoddescribe" id="describe"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">describe</span> (line <span class="line-number">770</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">tries to reduce all fields of the given table to basic datatypes</p>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			&amp;describe
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tableName</span><span class="var-description">: optional tablename to use</span>			</li>
				</ul>
		
			
	</div>
<a name="methodescape" id="escape"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">escape</span> (line <span class="line-number">256</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">escape possibly harmful strings so you can safely append them to an sql-string</p>
	<ul class="tags">
				<li><span class="field">return:</span> escaped string</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			escape
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$s</span><span class="var-description">: string to escape</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfind" id="find"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">find</span> (line <span class="line-number">509</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">select rows using various methods (see $method for full list)</p>
<p class="description"><p>$method can be:  'all': return all matching rows as an array of results  'list': return matching rows as a multidimensional array that use keynames from your supplied 'listby' fields. similar to $idfields of query()  'count': return number of rows matching  'first': return first matching row</p><p>$conditions is used to construct a suitable WHERE-clause. fieldnames are default AND connected, just add an 'or' somewhere to change that.  Example: 'conditions'=&gt;array('field1'=&gt;5',array('name LIKE'=&gt;'%eter','or','name LIKE'=&gt;'%eta'))</p><p>$order: array of fieldnames used to construct ORDER BY clause</p><p>$group: array of fieldnames used to construct GROUP BY clause</p><p>$listby: see above</p><p>$limit: how many rows to return (per page)  $page: which page to return (if $limit is set), first page is 1</p><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$rows&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methodfind">find</a><span class="src-sym">(</span><span class="src-str">'all'</span><span class="src-sym">,</span><span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'conditions'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(&nbsp;</span><span class="src-comm">//&nbsp;WHERE&nbsp;conditions&nbsp;to&nbsp;use.&nbsp;default&nbsp;all&nbsp;elements&nbsp;are&nbsp;AND,&nbsp;just&nbsp;add&nbsp;'or'&nbsp;to&nbsp;the&nbsp;condition-array&nbsp;to&nbsp;change&nbsp;this</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field'&nbsp;</span>=&gt;&nbsp;<span class="src-var">$thisValue</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'or'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field2'</span>=&gt;<span class="src-var">$value2</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field3'</span>=&gt;<span class="src-var">$value3</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field4'</span>=&gt;<span class="src-var">$value4</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'fields'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(&nbsp;</span><span class="src-comm">//array&nbsp;of&nbsp;field&nbsp;names&nbsp;that&nbsp;we&nbsp;should&nbsp;return.&nbsp;first&nbsp;field&nbsp;name&nbsp;is&nbsp;used&nbsp;as&nbsp;array-key&nbsp;if&nbsp;you&nbsp;use&nbsp;method&nbsp;'list'&nbsp;and&nbsp;listby&nbsp;is&nbsp;unset</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field1'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field2'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'order'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(&nbsp;</span><span class="src-comm">//string&nbsp;or&nbsp;array&nbsp;defining&nbsp;order.&nbsp;you&nbsp;can&nbsp;add&nbsp;DESC&nbsp;or&nbsp;ASC</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'created'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field3&nbsp;DESC'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'group'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(&nbsp;</span><span class="src-comm">//fields&nbsp;to&nbsp;GROUP&nbsp;BY</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'listby'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(&nbsp;</span><span class="src-comm">//only&nbsp;if&nbsp;find('list'):&nbsp;fields&nbsp;to&nbsp;arrange&nbsp;result-array&nbsp;by</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'field1'</span><span class="src-sym">,</span><span class="src-str">'field2'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'limit'&nbsp;</span>=&gt;&nbsp;<span class="src-num">50</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//int,&nbsp;how&nbsp;many&nbsp;rows&nbsp;per&nbsp;page</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'page'&nbsp;</span>=&gt;&nbsp;<span class="src-num">1</span><span class="src-sym">,&nbsp;</span><span class="src-comm">//int,&nbsp;which&nbsp;page,&nbsp;starting&nbsp;at&nbsp;1</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span><span class="src-str">'mytable'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			find
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span> = <span class="var-default">''</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">array ()</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$method</span><span class="var-description">: can be 'all','list','count','first','neighbors'</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$params</span><span class="var-description">: see example</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$tableName</span><span class="var-description">: string or null to use modelname</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetConfig" id="getConfig"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getConfig</span> (line <span class="line-number">144</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">getter for the config options of the current model</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getConfig
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$what</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$what</span><span class="var-description">: which part of the config you want returned. if null the whole config-array is returned</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetConnectionName" id="getConnectionName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getConnectionName</span> (line <span class="line-number">134</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return currently used connection name (see database.php)</p>
<p class="description"><p>* @return string</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getConnectionName
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetLink" id="getLink"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getLink</span> (line <span class="line-number">153</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">getter for the database link of the current model. whats returned here depends greatly on the dbo-class</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getLink
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetModel" id="getModel"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getModel</span> (line <span class="line-number">801</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">getModel() wrapper</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getModel
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$name</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetPrefix" id="getPrefix"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getPrefix</span> (line <span class="line-number">191</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">return the prefix configured for this connection</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getPrefix
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetTableName" id="getTableName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getTableName</span> (line <span class="line-number">164</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">utility function to generate correct tablename</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getTableName
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$n</span> = <span class="var-default">null</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$withPrefix</span> = <span class="var-default">true</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$quoted</span> = <span class="var-default">true</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$n</span><span class="var-description">: tablename to use. if null uses $this-&gt;useTable. if that is also null uses modelname.</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$withPrefix</span><span class="var-description">: if true adds prefix and adds the correct quote-signs to the name</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$quoted</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetWhereString" id="getWhereString"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getWhereString</span> (line <span class="line-number">321</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">construct a suitable where-clause for a query from an array of conditions</p>
	<ul class="tags">
				<li><span class="field">return:</span> full 'WHERE x=' string</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getWhereString
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$allowKey</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tableName</span><span class="var-description">: needed to generate a primary key name</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$allowKey</span>			</li>
				</ul>
		
			
	</div>
<a name="methodlog" id="log"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">log</span> (line <span class="line-number">79</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">convenience method for writeLog</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			log
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$what</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$where</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$what</span><span class="var-description">: what to log</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$where</span><span class="var-description">: where to log (KATA_DEBUG OR KATA_ERROR)</span>			</li>
				</ul>
		
			
	</div>
<a name="methodmakeDateTime" id="makeDateTime"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">makeDateTime</span> (line <span class="line-number">286</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">turn a unix timestamp into datetime-suitable SQL-function like FROM_UNIXTIME(timestamp) (depends on used dbo)</p>
	<ul class="tags">
				<li><span class="field">return:</span> sql-statement</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			makeDateTime
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$t</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$t</span><span class="var-description">: unix timestamp</span>			</li>
				</ul>
		
			
	</div>
<a name="methodpairs" id="pairs"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">pairs</span> (line <span class="line-number">296</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">turn the given array into &quot;name=value,name=value&quot; pairs suitable for INSERT or UPDATE-sqls. strings are automatically quoted+escaped, fieldnames also</p>
	<ul class="tags">
				<li><span class="field">return:</span> �foo�='bar',�baz�='ding'</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			pairs
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$params</span><span class="var-description">: the data</span>			</li>
				</ul>
		
			
	</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">query</span> (line <span class="line-number">202</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">execute an actual query on the database</p>
	<ul class="tags">
				<li><span class="field">return:</span> returns array with results OR integer with insertid OR integer updated rows OR null</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			&amp;query
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$idnames</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$s</span><span class="var-description">: the sql to execute</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$idnames</span><span class="var-description">: can be used to have the keys of the returned array equal the value ob the column given here (instead of just heaving 0..x as keys)</span>			</li>
				</ul>
		
			
			<hr class="separator" />
		<div class="notes">Redefined in descendants as:</div>
		<ul class="redefinitions">
					<li>
				<a href="../kata_model/ClusterModel.html#methodquery">ClusterModel::query()</a>
							</li>
				</ul>
	</div>
<a name="methodquote" id="quote"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">quote</span> (line <span class="line-number">266</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">enclose string in single-quotes AND escape it</p>
	<ul class="tags">
				<li><span class="field">return:</span> quoted AND escaped string</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			quote
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$s</span><span class="var-description">: string to escape</span>			</li>
				</ul>
		
			
	</div>
<a name="methodquoteName" id="quoteName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">quoteName</span> (line <span class="line-number">276</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">enclose table- or fildname in whatever the database needs (depends on used dbo)</p>
	<ul class="tags">
				<li><span class="field">return:</span> escaped name</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			quoteName
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$s</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$s</span><span class="var-description">: field or tablename</span>			</li>
				</ul>
		
			
	</div>
<a name="methodread" id="read"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">read</span> (line <span class="line-number">620</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">read data from the database.</p>
<p class="description"><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$rows&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methodread">read</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'foobarId'</span>=&gt;<span class="src-num">5</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$rows&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methodread">read</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'foobarId'</span>=&gt;<span class="src-num">6</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'and'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'someId'</span>=&gt;<span class="src-num">2</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">))</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			read
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">null</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$fieldName</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$id</span><span class="var-description">: array of fieldnames used to construct WHERE clause</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: return these colums (if null: all fields)</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tableName</span><span class="var-description">: read from this table (if ommitted: use tablename of this model, including prefix)</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$fieldName</span><span class="var-description">: string or array to use as key for the returned result, see query()</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreplace" id="replace"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">replace</span> (line <span class="line-number">752</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">REPLACE works exactly like Insert, but removes previous entries.</p>
<p class="description"><p>Warning: if an old row in the table has the same value as a new row for a PRIMARY KEY or a UNIQUE index,  the old row is deleted before the new row is inserted. In short: It may be that more than 1 row is deleted.</p><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methodreplace">replace</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'fooId'</span>=&gt;<span class="src-num">10</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'data1'</span>=&gt;<span class="src-num">20</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">))</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			replace
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">null</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>], <span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$id</span><span class="var-description">: primary key of row to replace</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: name=&gt;value pairs of new values</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$table</span><span class="var-description">: replace from this table (if ommitted: use tablename of this model, including prefix)</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$tableName</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetupDbo" id="setupDbo"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setupDbo</span> (line <span class="line-number">100</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">load dbo-class, give dbconfig to class</p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setupDbo
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$connName</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$connName</span><span class="var-description">: name of the connection to use</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupdate" id="update"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">update</span> (line <span class="line-number">719</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">update a row whose id is matching.</p>
<p class="description"><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../kata_model/Model.html#methodupdate">update</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'fooId'</span>=&gt;<span class="src-num">10</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-str">'data1'</span>=&gt;<span class="src-num">20</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">))</span><span class="src-sym">;</span></div></li>
</ol></div></p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			update
		</span>
					([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">null</span>], <span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$tableName</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$id</span><span class="var-description">: primary array of fields suitable to construct a WHERE clause</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: name=&gt;value pairs of new values</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$tableName</span><span class="var-description">: update data in this table (if ommitted: use tablename of this model, including prefix)</span>			</li>
				</ul>
		
			
	</div>
<a name="methodvalidate" id="validate"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">validate</span> (line <span class="line-number">793</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">checks the given values of the array match certain criterias</p>
	<ul class="tags">
				<li><span class="field">return:</span> true if everything is okay OR $params-array-key of the row that is not validating</li>
				<li><span class="field">deprecated:</span> 31.04.2009</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			validate
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">null</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$what</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$params</span><span class="var-description">: key/value pair. key is the name of the key inside the $what-array, value is a &quot;VALID_&quot; define (see above) OR the name of a (global) function that is given the string (should return bool wether the string validates) OR a regex string</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$what</span><span class="var-description">: the actual data, eg. GET/POST parameters</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 23 Sep 2010 16:25:55 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>